<?xml version="1.0" encoding="utf-8"?>

<!-- Contacts Addresses now have standardised Locational info to allow reuse of addresses and mappings -->

<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Contact</cContentSchemaName>
        <cContentXmlBrief>
          <Content>
            <GivenName/>
            <Surname/>
            <Title/>
            <Company/>
            <Department/>
            <Images>
              <img class="thumbnail"/>
              <img class="display"/>
              <img class="detail"/>
            </Images>
            <Telephone/>
            <Mobile/>
            <Fax/>
            <Email/>
            <Profile/>
          </Content>
        </cContentXmlBrief>
        <cContentXmlDetail>
          <Content>
            <GivenName/>
            <Surname/>
            <Title/>
            <Company/>
            <Department/>
            <Images>
              <img class="thumbnail"/>
              <img class="display"/>
              <img class="detail"/>
            </Images>

            <Location loc="address" map="">
              <Venue/>
              <Address>
                <No />
                <Street />
                <Locality />
                <Region />
                <PostCode />
                <Country />
              </Address>
              <Geo longitude="" latitude="" />
            </Location>
            <Telephone/>
            <Mobile/>
            <Fax/>
            <Email/>
            <Website/>
            <Profile/>
            <Description/>
          </Content>
        </cContentXmlDetail>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind nodeset="tblContent">
      <bind id="dPublishDate" nodeset="dPublishDate" required="false()" type="string"/>
      <bind id="dExpireDate" nodeset="dExpireDate" required="false()" type="string"/>
      <bind id="nStatus" nodeset="nStatus" required="true()" type="string"/>
      <bind nodeset="cContentXmlBrief/Content">
        <bind id="cContentGivenName" nodeset="GivenName" required="false()" type="string"/>
        <bind id="cContentSurname" nodeset="Surname" required="true()" type="string"/>
        <bind id="cContentTitle" nodeset="Title" required="false()" type="string"/>
        <bind id="cContentCompany" nodeset="Company" required="false()" type="string"/>
        <bind id="cContentDepartment" nodeset="Department" required="false()" type="string"/>
        <bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
        <bind id="cContentDisplay" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
        <bind id="cContentFullSizePicture" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
        <bind id="cContentTelephone" nodeset="Telephone" required="false()" type="string"/>
        <bind id="cContentMobile" nodeset="Mobile" required="false()" type="string"/>
        <bind id="cContentFax" nodeset="Fax" required="false()" type="string"/>
        <bind id="cContentEmail" nodeset="Email" required="false()" type="email"/>
        <bind id="cContentProfile" nodeset="Profile" required="false()" type="string"/>
        <bind id="cContentFacebook" nodeset="@facebookURL" required="false()" type="format:/(?:http:\/\/)?(?:www\.)?facebook\.com\/*"/>
        <bind id="cContentTwitter" nodeset="@twitterURL" required="false()" type="format:/(?:http:\/\/)?(?:www\.)?twitter\.com\/*"/>
        <bind id="cContentLinkedIn" nodeset="@linkedInURL" required="false()" type="format:/(?:http:\/\/)?(?:www\.)?linkedin\.com\/*"/>
        <bind id="cContentGooglePlus" nodeset="@googlePlusURL" required="false()" type="format:/(?:https:\/\/)?(?:plus\.)?google\.com\/*"/>
        <bind id="cContentPinterest" nodeset="@pinterestURL" required="false()" type="format:/(?:http:\/\/)?(?:www\.)?pinterest\.com\/*"/>
        <bind id="bNoLink" nodeset="@noLink" required="false()" type="string"/>
      </bind>
      <bind nodeset="cContentXmlDetail/Content">
        <bind id="cContentGivenName" nodeset="GivenName" required="false()" type="string"/>
        <bind id="cContentSurname" nodeset="Surname" required="true()" type="string"/>
        <bind id="cContentTitle" nodeset="Title" required="false()" type="string"/>
        <bind id="cContentCompany" nodeset="Company" required="false()" type="string"/>
        <bind id="cContentDepartment" nodeset="Department" required="false()" type="string"/>
        <bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
        <bind id="cContentDisplay" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
        <bind id="cContentFullSizePicture" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
        <bind nodeset="Location">

          <bind id="cContentLocationName" nodeset="Venue" required="false()" type="string"/>
          <bind nodeset="Address">
            <bind id="cContentLocationNo" nodeset="No" required="false()" type="string"/>
            <bind id="cContentLocationStreet" nodeset="Street" required="false()" type="string"/>
            <bind id="cContentLocationTown" nodeset="Locality" required="false()" type="string"/>
            <bind id="cContentLocationRegion" nodeset="Region" required="false()" type="string"/>
            <bind id="cContentLocationPostCode" nodeset="PostCode" required="false()" type="string"/>
          </bind>

          <!--<bind nodeset="Address">
            <bind id="cContentStreet" nodeset="Street" required="false()" type="string"/>
            <bind id="cContentCity" nodeset="City" required="false()" type="string"/>
            <bind id="cContentState" nodeset="State" required="false()" type="string"/>
            <bind id="cContentPostalCode" nodeset="PostalCode" required="false()" type="string"/>
          </bind>-->
        </bind>

        <bind id="cContentTelephone" nodeset="Telephone" required="false()" type="string"/>
        <bind id="cContentFax" nodeset="Fax" required="false()" type="string"/>
        <bind id="cContentMobile" nodeset="Mobile" required="false()" type="string"/>
        <bind id="cContentEmail" nodeset="Email" required="false()" type="email"/>
        <bind id="cContentWebsite" nodeset="Website" required="false()" type="string"/>
        <bind id="cContentProfile" nodeset="Profile" required="false()" type="string"/>
        <bind id="cContentBody" nodeset="Description" required="false()" type="string"/>
        <bind id="cContentFacebook" nodeset="@facebookURL" required="false()" type="string"/>
        <bind id="cContentTwitter" nodeset="@twitterURL" required="false()" type="string"/>
        <bind id="cContentLinkedIn" nodeset="@linkedInURL" required="false()" type="string"/>
        <bind id="cContentGooglePlus" nodeset="@googlePlusURL" required="false()" type="string"/>
        <bind id="cContentPinterest" nodeset="@pinterestURL" required="false()" type="string"/>
      </bind>
      <bind calculate="concat(tblContent/cContentXmlBrief/Content/GivenName,' ',tblContent/cContentXmlBrief/Content/Surname)" nodeset="cContentName" required="true()" type="string"/>
      <bind id="cDescription" nodeset="cDescription" required="false()" type="string"/>
    </bind>
  </model>
  <group ref="EditContent" class="2col">
    <label>Contact</label>
    <group>
      <group>
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <label>Settings</label>
        <input bind="dPublishDate" class="calendar short">
          <label>Publish date</label>
        </input>
        <input bind="dExpireDate" class="calendar short">
          <label>Expire date</label>
        </input>
        <select1 bind="nStatus" appearance="full" class="vshort">
          <label>Status</label>
          <item>
            <label>Live</label>
            <value>1</value>
          </item>
          <item>
            <label>Hidden</label>
            <value>0</value>
          </item>
        </select1>
        <input bind="cDescription" class="short">
          <label>Change notes</label>
        </input>
      </group>
      <group class="Content">
        <label>Images</label>
        <input bind="cContentFullSizePicture" class="short pickImage">
          <label>Main contact image</label>
          <help class="inline">
            <p>
              This image should generally be no larger than <b>800x600 pixels, at 72dpi.</b>
            </p>
            <p>The main image is automatically resized for other smaller images such as thumbnails.</p>
            <p>However if you would like a different image for the thumbnail or main product page, they can be specified below.</p>
          </help>
        </input>
        <hint>Smaller images will be automatically resized from the fullsize. If you want to use alterative images you can add them here.</hint>
        <input bind="cContentThumbnail" class="short pickImage">
          <label>Alternative thumbnail</label>
        </input>
        <input bind="cContentDisplay" class="short pickImage">
          <label>Alternative picture</label>
        </input>
      </group>
    </group>
    <group>
      <group class="inline">
        <label>Details</label>
        <input bind="cContentGivenName" class="short">
          <label>First name(s)</label>
        </input>
        <input bind="cContentSurname" class="short">
          <label>Surname</label>
        </input>
        <input bind="cContentTitle" class="short">
          <label>Job title</label>
        </input>
        <input bind="cContentCompany" class="short">
          <label>Company</label>
        </input>
        <input bind="cContentDepartment" class="short">
          <label>Department</label>
        </input>
      </group>

      <group class="inline">
        <label>Contact details</label>
        <input bind="cContentTelephone" class="short">
          <label>Telephone</label>
        </input>
        <input bind="cContentMobile" class="short">
          <label>Mobile</label>
        </input>
        <input bind="cContentFax" class="short">
          <label>Fax</label>
        </input>
        <input bind="cContentEmail" class="short">
          <label>Email</label>
        </input>
        <input bind="cContentWebsite" class="short">
          <label>Website</label>
        </input>
      </group>
      <group class="inline">
        <label>Social Media Links</label>
        <input bind="cContentFacebook" class="short">
          <label>Facebook URL</label>
        </input>
        <input bind="cContentTwitter" class="short">
          <label>Twitter URL</label>
        </input>
        <input bind="cContentLinkedIn" class="short">
          <label>LinkedIn URL</label>
        </input>
        <input bind="cContentGooglePlus" class="short">
          <label>Google+ URL</label>
        </input>
        <input bind="cContentPinterest" class="short">
          <label>Pinterest URL</label>
        </input>
        <hint class="long">
          All URL's must start with http:// ... etc.
        </hint>
      </group>
      <group class="inline">
        <label>Address</label>
        <input bind="cContentLocationName" class="short">
          <label>Building name</label>
        </input>
        <input bind="cContentLocationNo" class="vshort">
          <label>No.</label>
        </input>
        <input bind="cContentLocationStreet">
          <label>Street</label>
        </input>
        <input bind="cContentLocationTown">
          <label>Town/city</label>
        </input>
        <input bind="cContentLocationRegion">
          <label>County/state</label>
        </input>
        <input bind="cContentLocationPostCode" class="vshort">
          <label>Postal code</label>
        </input>
      </group>

      <!--<group class="inline">
        <label>Addresses</label>
        <input bind="cContentStreet" class="short">
          <label>Street</label>
        </input>
        <input bind="cContentCity" class="short">
          <label>Town/City</label>
        </input>
        <input bind="cContentState" class="short">
          <label>County/State</label>
        </input>
        <input bind="cContentPostalCode" class="short">
          <label>Post/Zip Code</label>
        </input>
        
      </group>-->
      <group>
        <label>Details</label>
        <label>Short profile</label>
        <textarea bind="cContentProfile" class="TextArea xhtml" rows="5" cols="70"></textarea>
        <label>Full profile</label>
        <textarea bind="cContentBody" class="TextArea xhtml" rows="15" cols="70"></textarea>

        <select bind="bNoLink" appearance="full" class="multiline">
          <item>
            <label>Don't link to contact details</label>
            <value>true</value>
          </item>
          <help class="inline">This will remove the 'read more' button from the bottom of this contact, so that only the information shown in this contact list is available, without an additional page for further information</help>
        </select>
      </group>
    </group>
  </group>

  <group ref="submit" class="contentSubmit">
    <submit submission="" ref="ewSubmit" class="principle">
      <label>Save Contact</label>
    </submit>
  </group>
</Content>
